package org.mtmi.ui.controls.edits;

import org.eclipse.swt.graphics.Color;
import org.mtmi.ui.controls.Control;
import org.mtmi.ui.drawables.ColorDrawable;
import org.mtmi.ui.drawables.IColorDrawable;

/**
 * Action to change foreground of control.
 */
public class ControlForegroundAction extends AbstractChooseColorAction 
{

	@Override
	protected Color getColor( Control c ) {
		return c.getForeground();
	}

	@Override
	protected void setColor( Control control, Color c ) {
		control.setForeground( c );
	}

	@Override
	protected boolean isControlHandled( Control c ) {
		return true;
	}
	
	@Override
	protected IColorDrawable createColorDrawable() {
		return new ColorDrawable( null, false );
	}

}
